home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / spwno413.zip / SOURCE.ZIP / _SPAWNE.C < prev    next >
C/C++ Source or Header  |  1992-12-12  |  1KB  |  44 lines

  1. /********************************************************************/
  2. /*   SPAWNO v4.13  EMS/XMS/disk swapping replacement for spawn...() */
  3. /*   (c) Copyright 1991,1992 Ralf Brown  All Rights Reserved        */
  4. /*                                    */
  5. /*   May be freely copied provided that this copyright notice is    */
  6. /*   not altered or removed.                        */
  7. /********************************************************************/
  8.  
  9. #include <alloc.h>
  10. #include "_spawno.h"
  11.  
  12. int _Cdecl spawnve(int type,const char *prog_name,const char **args,
  13.           const char **env)
  14. {
  15.    if (type != P_WAIT)
  16.       {
  17.       errno = EINVAL ;
  18.       return -1 ;
  19.       }
  20.    return spawnveo(___spawn_swap_dirs,prog_name,args,env) ;
  21. }
  22.  
  23.  
  24. int _Cdecl spawnle(int type,const char *prog_name, ...)
  25. {
  26.    int retval ;
  27.    va_list env ;
  28.  
  29.    if (type != P_WAIT)
  30.       {
  31.       errno = EINVAL ;
  32.       return -1 ;
  33.       }
  34.    va_start(env,prog_name) ;
  35.    while (*((char **)env))  /* find NULL terminating list of program args */
  36.       va_arg(env,void *) ;
  37.    va_arg(env,const char **) ;     /* point at pointer to list of env variables */
  38.    retval = spawnveo(___spawn_swap_dirs,prog_name,(const char **)_va_ptr,
  39.              *((const char ***)env)) ;
  40.    va_end(env) ;
  41.    return retval ;
  42. }
  43.  
  44.